<?php session_start(); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
	<?php
		// start 验证是否登录，如果没有登录跳转到登录页面
		if ( @!($_COOKIE['login'] == 'true') ) {
			echo '<meta http-equiv="Refresh" content="0;URL=login.php" />';
			exit;
		}
		// end 验证是否登录，如果没有登录跳转到登录页面
		// start 包含文件
		include_once('../mysql_connection.php');
		include_once('../setting.php');
		include_once('../lib/functions.php');
		// end 包含文件
		// start 取得不包括路径的当前脚本文件名
		$now_url = $_SERVER['PHP_SELF'];
		$now_filename = end(explode('/',$now_url));
		// end 取得不包括路径的当前脚本文件名
	?> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="icon" href="../images/favicon.ico" type='image/vnd.microsoft.icon' />
	<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
	<script src="../javascript/function.js" type="text/javascript"></script>
	<script type="text/javascript">
		window.onload = function show_daohang_bg() {
			var daohang_obj = document.getElementById("<?php echo $now_filename;?>");
			daohang_obj.style.background="#cccccc";
		}
	</script>
</head><body><div id="content">
	<div id="header">
		<a href="../index.php"><?php echo $setting['site_name']; ?></a>
	</div>
	<div id="daohang_root">
		<div class="a_daohang_root">日志</div>
		<div class="b_daohang_root" id="new_post.php"><a href="new_post.php">发表文章</a></div>
		<div class="b_daohang_root" id="add_link.php"><a href="add_link.php">添加链接</a></div>
		<div class="b_daohang_root" id="link_manager.php"><a href="link_manager.php">链接管理</a></div>
		<div class="b_daohang_root" id="manager_category.php"><a href="manager_category.php">管理分类</a></div>
		<div class="b_daohang_root" id="edit_del_article.php"><a href="edit_del_article.php">管理文章</a></div>
		<div class="b_daohang_root" id="edit_comment.php"><a href="edit_comment.php">评论管理</a></div>
		<hr />
		<div class="a_daohang_root">设置</div>
		<div class="b_daohang_root" id="general_setting.php"><a href="general_setting.php">常规设置</a></div>
		<div class="b_daohang_root" id="write_setting.php"><a href="write_setting.php">撰写设置</a></div>
		<div class="b_daohang_root" id="read_setting.php"><a href="read_setting.php">阅读设置</a></div>
		<div class="b_daohang_root" id="sidebar_setting.php"><a href="sidebar_setting.php">侧栏设置</a></div>
		<div class="b_daohang_root" id="footer_setting.php"><a href="footer_setting.php">页脚设置</a></div>
		<div class="b_daohang_root" id="edit_user.php"><a href="edit_user.php">用户信息设置</a></div>
		<hr />
		<div class="a_daohang_root"><a href="logout.php"><strong>Logout/退出登录</strong></a></div>
	</div>
	<div id="message_box">
		<?php
			if ($_SERVER['REQUEST_METHOD']=='POST') {
				if (isset($_GET['message_box'])) {
					echo $_GET['message_box'];
				}
			}
		?>
	</div>
	<?php
		if($_SERVER['REQUEST_METHOD']=='POST') {
			if (isset($_GET['message_box']) and !isset($_POST['edit_submit'])) {
			?>
			<script language="javascript">
				document.getElementById("message_box").style.display="block";
			</script>
			<?php
			}
		}
	?>
